/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.dorian.atomicuml.orm;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedNativeQueries;
import javax.persistence.NamedNativeQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Ayden
 */
@Entity
@Table(name = "PROJECTS", schema= "dorian")
@NamedNativeQueries({
    @NamedNativeQuery(name = "Projects.findById", query = "SELECT * FROM Projects p WHERE p.id = :id", resultClass=Projects.class),
    @NamedNativeQuery(name = "Projects.findByTitle", query = "SELECT * FROM Projects p WHERE p.title = :title", resultClass=Projects.class),
    @NamedNativeQuery(name = "Projects.findByDescription", query = "SELECT * FROM Projects p WHERE p.description = :description", resultClass=Projects.class),
    @NamedNativeQuery(name = "Projects.findByDatemodif", query = "SELECT * FROM Projects p WHERE p.datemodif = :datemodif", resultClass=Projects.class),
    @NamedNativeQuery(name = "Projects.findByDatecreate", query = "SELECT * FROM Projects p WHERE p.datecreate = :datecreate", resultClass=Projects.class)})
public class Projects implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID")
    private Integer id;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 128)
    @Column(name = "TITLE")
    private String title;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 128)
    @Column(name = "DESCRIPTION")
    private String description;
    @Basic(optional = false)
    @NotNull
    @Column(name = "DATEMODIF")
    @Temporal(TemporalType.DATE)
    private Date datemodif;
    @Basic(optional = false)
    @NotNull
    @Column(name = "DATECREATE")
    @Temporal(TemporalType.DATE)
    private Date datecreate;
    @Basic(optional = false)
    @NotNull
    @Column(name = "OWNER_ID")
    private Integer ownerId;
    
    public Projects() {
    }

    public Projects(Integer id) {
        this.id = id;
    }

    public Projects(Integer id, String title, String description, Date datemodif, Date datecreate, Integer ownerId) {
        this.id = id;
        this.title = title;
        this.description = description;
        this.datemodif = datemodif;
        this.datecreate = datecreate;
        this.ownerId = ownerId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Date getDatemodif() {
        return datemodif;
    }

    public void setDatemodif(Date datemodif) {
        this.datemodif = datemodif;
    }

    public Date getDatecreate() {
        return datecreate;
    }

    public void setDatecreate(Date datecreate) {
        this.datecreate = datecreate;
    }

    public Integer getOwnerId() {
        return ownerId;
    }

    public void setOwnerId(Integer ownerId) {
        this.ownerId = ownerId;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Projects)) {
            return false;
        }
        Projects other = (Projects) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.dorian.atomicuml.orm.Projects[ id=" + id + " ]";
    }
    
}
